package com.goblin.model.film.controller;

import com.goblin.common.response.PageHelper;
import com.goblin.common.response.Paged;
import com.goblin.common.response.Response;
import com.goblin.model.base.BaseController;
import com.goblin.model.film.po.Comment;
import com.goblin.model.film.po.Film;
import com.goblin.model.film.service.CommentService;
import com.goblin.model.film.service.FilmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/v1/film/comment")
public class CommentController extends BaseController<Comment> {

	@Autowired
	private CommentService commentService;

	@GetMapping("/comments/{id}")
	public Response<Paged<Comment>> paged(PageHelper pageable, @PathVariable Integer id) {
		Paged<Comment> entities = this.commentService.paged(pageable, id);
		return Response.success(entities);
	}

}
